Hello and welcome to
this demonstration on using a While
activity in Studio. In this video, you will learn to create a workflow
that prints a list of numbers starting from
one to the number of your choice using
a While activity. So let's begin. Search for an Input
Dialog activity in the Activities panel and drag and drop it in
the Designer panel. Rename the automatically created sequences ''While loop'' and
add an annotation to it. Rename the Input Dialog
activity as ''User Input''. In double-quotes,
enter the title text, enter number in the
Dialogue title, and Label Text,
enter any number of your choice in the
Input Label box. From the Variables panel, create a variable intNumber, with variable type as int32, and Scope as
Sequence-While loop. Go to the Properties panel of the User Input Dialog activity, and enter the variable intNumber
in its result property. Drag and drop an
assign activity below the Input Dialog
activity and rename it. In the two text box
press ''Control + K" to create a new variable. Name it as, "intTemp", and enter one in
the adjacent box. From the Variables panel, set its Variable Type to int32. Drag and drop a while activity below the Assign
activity and rename it. The while activity will run the loop until the
given condition is met. In the Condition box of
the While activity enter "intTemp less than or
equal to intNumber". In the body section of
the While activity, insert a Write Line
activity and rename it. In the textbox of the activity, enter the expression
"intTemp.ToString". Insert an assign activity
below Write Line activity. Let's rename this
assign activity. In the two text box, enter the variable "intTemp" and enter "intTemp+1" in
the adjacent text box. Click "Save" to save
the project and run it. Enter 10 in the input
box, and click "OK". Go to the UiPath
Studio application to check the output
panel for the result. Here, you can see that the numbers are
printed from 1-10; hence, the workflow
ran successfully. It is encouraged to create
the workflow as demonstrated, and try displaying
the numbers of your choice using
the While activity. Thank you for watching.